<?php
// ------------------------------------------------------------------------
// |@Author       : Jarmin <edshop@qq.com>
// |@----------------------------------------------------------------------
// |@Date         : 2023-07-12 18:00:15
// |@----------------------------------------------------------------------
// |@LastEditTime : 2023-11-28 23:18:35
// |@----------------------------------------------------------------------
// |@LastEditors  : Jarmin <jarmin@ladmin.cn>
// |@----------------------------------------------------------------------
// |@Description  : 
// |@----------------------------------------------------------------------
// |@FilePath     : Config.php
// |@----------------------------------------------------------------------
// |@Copyright (c) 2023 http://www.ladmin.cn   All rights reserved. 
// ------------------------------------------------------------------------
namespace app\setting\controller;

use think\admin\Controller;

class Config extends Controller
{
    /**
     * 获取配置列表
     * @return void
     */
    public function list()
    {
        $result = $this->logicConfig->getList($this->app->request->param());
        // 判断操作结果
        if ($result['code'] === SUCCESS) {
            return $this->success($result['data'], $result['message']);
        } else {
            return $this->error($result['code'], $result['message']);
        }
    }

    /**
     * 设置显示语言
     * @return void
     */
    public function lang()
    {
        $result = $this->logicConfig->setLang($this->app->request->post());
        // 判断操作结果
        if ($result['code'] === SUCCESS) {
            return $this->success($result['data'], $result['message']);
        } else {
            return $this->error($result['code'], $result['message']);
        }
    }

    /**
     * 保存系统配置
     * @return void
     */
    public function save()
    {
        $result = $this->logicConfig->saveList($this->app->request->post());
        // 判断操作结果
        if ($result['code'] === SUCCESS) {
            return $this->success($result['data'], $result['message']);
        } else {
            return $this->error($result['code'], $result['message']);
        }
    }
}